<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="layoutmode" content="standard">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="renderer" content="webkit">
    <meta name="wap-font-scale" content="no">
    <meta content="telephone=no" name="format-detection">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="stylesheet" type="text/css" href="../css/base2.min.css"/>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.0/css/swiper.min.css">
</head>
<style>
    .yinhang{
        top: 0.8rem;
        line-height: 0.26rem;
        padding-top: 0.02rem;
        height: 0.55rem;
        -webkit-text-size-adjust: none;

    }
    .yinhang span{
        transform: scale(0.9);
        display: inline-block;
    }
    .js_lq_list span{
        transform: scale(0.9);
        display: inline-block;
    }
</style>
<body class="w_body" >
<div class="back_div">
    <div class="top">
        <div class="div_logo"></div>

<!--        <div class="pinan-app"></div>-->
        <div class="js_lq_jl yinhang js_go_down" style=""><span>平安银行<br>App下载</span></div>
        <div class="js_lq_jl js_lq_list"><span>领取记录</span></div>
    </div >
    <div id="part1">
        <div class="back_color">
            <img src="../images/banner1.jpg" alt="" class="title">
            <div class="title-hint2"></div>

        </div>

        <div class="back_color js_jp_list">
        </div>
    </div>
    <div class="bottom-code" style="margin-top:0.2rem;height: 11%;"><img src="../images/code.png" alt=""></div>
</div>
<div class="mask"></div>
<div class="show_div js_lq_one po_top">
    <div class="show_msg">
        <div class="show_msg_title"><div class="js_hide div_hide" style="">×</div></div>
        <div class=" lq_content" style="    text-align: center;">
            <input data-name="name" placeholder=" 请输入姓名">
            <input data-name="id_card" placeholder=" 请输入身份证后四位">
        </div>
        <div data-type="1" class="show_msg_button js_go_btn"></div>
    </div>
</div>
<div class="show_div js_lq_two po_top">
    <div class="show_msg">
        <div class="show_msg_title"><div class="js_hide div_hide" style="">×</div></div>
        <div class=" lq_content" style="    text-align: center;">
            <input data-name="name" placeholder=" 请输入姓名">
            <input data-name="id_card" placeholder=" 请输入身份证后四位">
        </div>
        <div data-type="1" class="show_msg_button js_go_btn"></div>
    </div>
</div>
<div class="show_div js_lq_three po_top">
    <div class="show_msg">
        <div class="show_msg_title"><div class="js_hide div_hide" style="">×</div></div>
        <div class=" lq_content" style="    text-align: center;">
            <input data-name="name" placeholder=" 请输入姓名">
            <input data-name="id_card" placeholder=" 请输入身份证后四位">
            <input data-name="phone" placeholder=" 请输入要充值的手机号">
        </div>
        <div data-type="1" class="show_msg_button js_go_btn"></div>
    </div>
</div>
<div class="show_div js_lq_four po_top">
    <div class="show_msg">
        <div class="show_msg_title"><div class="js_hide div_hide" style="">×</div></div>
        <div class="lq_content" style="    text-align: center;">
            <input data-name="name" placeholder=" 请输入姓名">
            <input data-name="id_card" placeholder=" 请输入身份证后四位">
            <input data-name="phone" placeholder=" 请输入手机号">
            <input data-name="address" placeholder=" 请输入收货地址">
        </div>
        <div data-type="1" class="show_msg_button js_go_btn"></div>
    </div>
</div>
<div class="show_div info_top js_show_info" style="width: 100%;">
    <div class="js_hide div_hide new_hide" style=""></div>
    <div class="show_msg gz_show" style="    margin: auto;">
        <div class="show_msg_title"></div>
        <textarea class="text_style show_msg_content js_info_content" style="" >
        </textarea>
    </div>
</div>
</body>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/rem.js"></script>
<script type="text/javascript" src="../js/base.js"></script>
<script type="text/javascript" src="../js/layer/layer.js"></script>
<script>
    $(function () {
        $.ajax({
            url: apiPath+"api/Index/lipinglist",
            type: "GET",
            data: {
            },
            dataType: "json",
            success: function(data) {
                console.log(data)
                var code=data.StatusCode;
                if(code==1){
                var array=data.data;
                    for(var i=0;i<array.length;i++){
                        var info=array[i];
                        var html='<div>\n' +
                            '                <div class="bag_list">\n' +
                            '                    <div class="jp_name">\n' +
                            '                        <div>'+info.name+'</div>\n' +
                            '                    </div>\n' +
                            '                    <div data-id="'+info.id+'" data-guize="'+info.guize+'" onclick="chakan('+info.type+')" class="jp_info_click">查看详情</div>\n' +
                            '\n' +
                            '                </div>\n' +
                            '                <div style="text-align: center;">\n' +
                            '                    <div data-type="'+info.type+'"  data-id="'+info.id+'" class="btn lingqu js_lingqu"></div>\n' +
                            '                </div>\n' +
                            '            </div>'
                       $(".js_jp_list").append(html);
                    }
                } else {
                    msg("网络错误")
                }
            }
        });
    })
    var id=null;
    var redName=null;
    var redCard=null;
    $(".js_jp_list").on('click','.js_lingqu',function(){
        id=$(this).data("id");
        var type=$(this).data("type");
        $(".show_div").hide();
        var juli=topDistance(this);
        console.log(juli);
        $(".po_top").css("top",(juli-180)+"px");
        if(type=="1"){
            $(".js_lq_one").show();
        }else if(type=="2"){
            $(".js_lq_two").show();
        }else if(type=="3"){
            $(".js_lq_three").show();
        }else if(type=="4"){
            $(".js_lq_four").show();
        }

    })
    $(".js_go_btn").click(function () {
        var parent=$(this).prev();
        var chil=$(parent).children("input")
        var data={"id":id,"address":"","id_card":"","phone":""};
        for(var i=0;i<chil.length;i++){
            var l=chil[i];
            var key=$(l).data("name");
            var val=$(l).val();
            data[key]=val;
        }
        redName=data["name"];
        redCard=data["id_card"];
        console.log(data);
        $.ajax({
            url: apiPath+"api/Index/usertoken",
            type: "POST",
            data:data,
            dataType: "json",
            success: function(data) {
                var code=data.StatusCode;
                if(code==-1){
                    layer.msg(data.msg)
                }
                if(code==1){
                    layer.msg(data.msg,function () {
                        window.location.href = basePath+'/bank/html/user.html?name='+redName+'&id_card='+redCard;
                    })
                }
            }
        });
    });
    $(".js_lq_list").click(
        function(){
            location.href = basePath+'/bank/html/user.html'
        }

    )
    $(".js_go_down").click(function () {
        window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.pingan.paces.ccms'
    })
    $(".js_hide").click(function () {
        $(".show_div").hide();
    })
    function chakan(type) {

        if(type==1){
             var hh='卷码类优惠卷使用说明';
        }
        if(type==2){
            var hh='图片卷码类优惠卷使用规则';
        }
        if(type==3){
            var hh='话费礼品使用说明';
        }
        if(type==4){
            var hh='实物礼品使用说明';
        }

        var top = ($(window).height() - $(".js_show_div").height())/2;
        var left = ($(window).width() - $(".js_show_div").width())/2;
        var scrollTop = $(document).scrollTop();
        var scrollLeft = $(document).scrollLeft();

        $(".show_msg_content").append(hh);
        $(".js_show_div").css( { position : 'absolute', 'top' : top + scrollTop, left : left + scrollLeft } ).show();
        // $(".js_show_div").show();

    }

    $(".js_jp_list").on('click','.jp_info_click',function(){
        var guize=$(this).data("guize");
        $(".js_info_content").empty();
        $(".js_info_content").append(guize);
        var juli=topDistance(this);
        $(".info_top").css("top",(juli-210)+"px");
        $(".js_show_info").show();
    })
</script>

</html>